#include"threadpoll.hh"
#include"Task.hh"
#include<memory>
#include<iostream>

using std::cout;
using std::endl;
using std::unique_ptr;

int main(void)
{
    //创建一个ptr
    unique_ptr<Task> _pt(new MyTask());

    ThreadPool pool(4,10);

    pool.start();

    for(int i=0;i<20;i++)
    {
        pool.addTask(_pt.get());
        cout<<"now i: "<<i<<endl;
    }

    pool.stop();
}
